<template>
    <div>
        <ul v-if="clazzId">
            <li><router-link to="/add-clazz">添加班级信息</router-link></li>
            <li><router-link to="/view-clazz-list">查看班级列表</router-link></li>

            <li><router-link :to="`/add-student-messages/clazzid/${store.clazzId}`">导入某班级学生</router-link></li>
            <li><router-link :to="`/view-students/clazzid/${store.clazzId}`">查看某班级学生</router-link></li>

            <li><router-link :to="`/add-course-schedule/clazzid/${store.clazzId}`">填写某班级课程安排信息</router-link></li>
            <li><router-link :to="`/view-course-schedules/clazzid/${store.clazzId}`">查看班级课程安排</router-link></li>


            <li>
                <a href="#" @click.prevent="deleteAllCourseSchedules">删除所有课程安排信息和考勤信息</a>
            </li>
            <li>
                <a to="#" @click="deleteAllStudentMessages">删除所有学生信息</a>
            </li>


            <li><router-link :to="`/clazz/${store.clazzId}/week/${week}/day/${day}`">查看班级考勤</router-link></li>
            <li><router-link :to="`/clazz/${store.clazzId}/students`">查看班级学生</router-link></li>

            <li><router-link
                    :to="`/view-attendance-list/week/${week}/day/${day}/clazzid/${store.clazzId}`">查看班级考勤列表</router-link>
            </li>

            <li><a @click="logout">退出登录</a></li>
        </ul>
    </div>
</template>

<script setup>
import { useUserStore } from '@/stores/user';
import { storeToRefs } from 'pinia';

const store = useUserStore();
const { clazzId, week, day } = storeToRefs(store);
const logout = () => {
    store.logout();
    window.location.href = '/login';
}

</script>